1 IDENTIFICATION DIVISION
2 PROGRAM-ID Damped_Oscillator
13 COEFFICIENT.1 InitialPosition
14 COEFFICIENT.2 InitialSpeed
15 COEFFICIENT.3 SpringForce
16 COEFFICIENT.4 Damping # linear to speed
17 COEFFICIENT.5 Mass # 1 / mass
20 # Colors being used for wiring
26 -1 -> COEFFICIENT.InitialPosition -> -y0 # -initial position of the mass
27 -1 -> COEFFICIENT.InitialSpeed -> y0s’ # y’ is scaled to be within -1..+1
28 +1, y0s’, y0s’ -> SUMMER -> y0’
29 y’’, IC:y0’ -> INTEGRATOR -> -y’
30 -y’,IC:-y0 -> INTEGRATOR -> y
31 y -> COEFFICIENT.SpringForce -> S*y # springforce times displacement
33 y’ -> COEFFICIENT.Damping -> D*y’ # damping times speed
34 S*y, D*y’ -> SUMMER -> -(Dy’+Sy)
35 -(Dy’+Sy) -> COEFFICIENT.Mass -> -1/m*(Dy’+Sy)=y’’